package org.huangrui.spark.scala.core.rdd.operate

import org.apache.spark.{SparkConf, SparkContext}

/**
 * 分区内有序，分区间无序
 * @Author hr
 * @Create 2024-10-16 19:25
 */
object Spark02_Operate_Transform_Map_2 {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setMaster("local[*]").setAppName("spark")
    val sc = new SparkContext(conf)
    val nums = List(1, 2, 3, 4, 5, 6)
    val rdd = sc.parallelize(nums, 2)
    val newRdd = rdd.map((x: Int) => {
      println(s"@@x = $x")
      x * 2
    })

    val ints = newRdd.collect()
    sc.stop()
  }
}
